{extend name="$_admin_layout"}

{block name="tpl_vars"}
    {eq name="_request_action" value="create"}
        {php}$page_title = '新建公众号';{/php}
    {else /}
        {php}$page_title = '修改公众号：' . $mp_info['name'];{/php}
    {/eq}
{/block}

{block name="main-content"}
    <form id="mp_form" class="form form-manager">
        <div class="box box-default no-heading">
            <div class="box-body">

                <div class="row">
                    <div class="col-sm-12">
                        {:helper('admin/form')->render_group('mp_number', $mp_info['mp_number'], 'text', '微信号')}
                        {:helper('admin/form')->render_group('name', $mp_info['name'], 'text', '名称')}
                        {:helper('admin/form')->render_group('type', $mp_info['type'], 'select', '名称', null, ['list' => $mp_type_list])}
                        {:helper('admin/form')->render_group('appid', $mp_info['appid'], 'text', 'AppID')}
                        {:helper('admin/form')->render_group('appsecret', $mp_info['appsecret'], 'text', 'AppSecret')}
                        {:helper('admin/form')->render_group('encodingaeskey', $mp_info['encodingaeskey'], 'text', 'EncodingAESKey')}
                        {:helper('admin/form')->render_group('token', $mp_info['token'], 'text', 'Token')}
                        {:helper('admin/form')->render_group('origin_id', $mp_info['origin_id'], 'text', '原始ID')}
                        {:helper('admin/form')->render_group('status', $mp_info['status'], 'status', '状态')}
                        {:helper('admin/form')->render_submit_and_cancel(request()->url(), $_controller->url('index'))}
                    </div>
                    
                    
                        <script type="text/javascript">
                            $(function(){
                                $('#mp_form').bootstrapValidator({
                                    fields: {
                                    	mp_number: {
                                            validators: {
                                                notEmpty: {
                                                    message: '微信号不能为空。',
                                                },
                                            },
                                        },
                                        name: {
                                            validators: {
                                                notEmpty: {
                                                    message: '名称不能为空。',
                                                },
                                            },
                                        },
                                    },
                                });
                            });
                        </script>
                    </div>
                </div>

            </div><!-- /.box-body -->
        </div><!-- /.box -->
    </form>
{/block}